package com.github.cakin.shiro.chapter18.oauth2;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * @className: OAuth2Token
 * @description: 类似于 UsernamePasswordToken 和 CasToken；用于存储 oauth2 服务端返回的 auth code。
 * @date: 2020/5/27
 * @author: cakin
 */
public class OAuth2Token implements AuthenticationToken {

    public OAuth2Token( String authCode ) {
        this.authCode = authCode;
    }

    /**
     * 认证码
     */
    private String authCode;
    /**
     * 身份信息
     */
    private String principal;

    public String getAuthCode() {
        return authCode;
    }

    public void setAuthCode( String authCode ) {
        this.authCode = authCode;
    }

    public String getPrincipal() {
        return principal;
    }

    public void setPrincipal( String principal ) {
        this.principal = principal;
    }

    public Object getCredentials() {
        return authCode;
    }
}
